<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="user/_fragment :: head(~{::title})">
    <title>博客管理后台</title>
</head>
<body class="hold-transition skin-blue sidebar-mini">

<!--头部导航-->
<nav th:replace="user/_fragment :: left-menu"></nav>
<!----------------------------------------------------------------------------------------->

<!-- 内容区域 -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            写博客
            <small>myblog</small>
        </h1>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-info">
                    <div style="color: darkred" th:text="${msg}"></div>
                    <form method="post" th:action="@{/passage/add}">
                        <div class="box-header">
                            <h3 class="box-title">标题</h3>
                            <!--class="form-control" -->
                            <input name="title" type="text" class="myinput">
                        </div>
                        <div class="box-header">
                            <h3 class="box-title" style="margin-top: 0%">描述</h3>
                            <textarea name="described" maxlength="100" wrap="soft" rows="3" class="myinput" style="height: 65px" placeholder="  tip：最多只能输入100个字符"></textarea>
                        </div>
                        <div class="box-header">
                            <h3 class="box-title">所属分类</h3>
                            <select name="catagoryId" style="margin-left: 7px">
                                <option th:each="c:${catagoryList}" th:value="${c.catagoryId}" th:text="${c.catagoryName}" style="height: 65px;border: 0.5px solid lightgray"></option>
                            </select>
                            <!--<button type="button" style="margin-left: 7px">添加新的分类</button>-->
                        </div>
                        <!-- Single button -->
                        <div class="box-header">
                            <h3 class="box-title">文章类型</h3>
                            <input name="isOriginal" type="radio" class="minimal" checked style="margin-left: 7px" value="1"> 原创
                            <input name="isOriginal" type="radio" class="minimal" style="margin-left: 7px" value="0"> 转载
                            <input name="originalPassageId" type="text" class="myinput" style="width: 59%" placeholder="  请填写原文链接">
                        </div>
                        <div class="box-header">
                            <h3 class="box-title">正文
                                <small>请在下面书写本篇博文的正文内容</small>
                            </h3>
                        </div>
                        <!--文本框-->
                        <div class="box-body pad">
                            <textarea id="editor1" name="content" rows="10" cols="80"></textarea>
                        </div>
                        <!--按钮-->
                        <div class="box-footer">
                            <input type="radio" name="isDraft" value="1" checked>草稿
                            <input type="radio" name="isDraft" value="0" style="margin-left: 7px">正式文
                            <font style="margin-left: 7px">|</font>
                            <input type="radio" name="isPrivate" value="1" style="margin-left: 7px" >私有
                            <input type="radio" name="isPrivate" value="0" checked>公开
                            <button type="submit" class="btn btn-primary" style="margin-left: 5%">提交</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!-- ./row -->
    </section>
    <!-- /.content -->
</div>
<!-- 内容区域 /-->

<!----------------------------------------------------------------------------------------->
<!--底部footer-->
<footer th:replace="user/_fragment :: footer"></footer>
</body>

<th:block th:replace="user/_fragment :: script">
</th:block>
<!--新+的-->
<!-- CK Editor -->
<script src="../../static/bower_components/ckeditor/ckeditor.js"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="../../static/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<style>
    .mybutton{
        margin-left: 5px;

    }
    .myinput {
        margin-left: 7px;
        margin-right: 7px;
        width: 70%;
        height: 28px;
        border: 0.5px solid lightgray;
        outline: none;
    }
</style>
<script>
    //ck编辑器
    $(function () {
        // Replace the <textarea id="editor1"> with a CKEditor
        // instance, using default configuration.
        CKEDITOR.replace('editor1');
        //bootstrap WYSIHTML5 - text editor
        $('.textarea').wysihtml5();
    });
    // 设置激活菜单
    function setSidebarActive(tagUri) {
        var liObj = $("#" + tagUri);
        if (liObj.length > 0) {
            liObj.parent().parent().addClass("active");
            liObj.addClass("active");
        }
    }
    $(document).ready(function() {
        // 激活导航位置
        setSidebarActive("blog-write");
    });
</script>

</html>
